package ru.mipt.sport.model.entity;

import java.io.Serializable;
import java.util.Objects;

/**
 *
 * @author Danon
 */
public class CompetitionRunId implements Serializable {

    private Long competitionId;
    private String code;
    
    public CompetitionRunId() {
        
    }
    
    public CompetitionRunId(Long competitionId, String code) {
        this.competitionId = competitionId;
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public Long getCompetitionId() {
        return competitionId;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final CompetitionRunId other = (CompetitionRunId) obj;
        if (!Objects.equals(this.competitionId, other.competitionId)) {
            return false;
        }
        if (!Objects.equals(this.code, other.code)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 29 * hash + Objects.hashCode(this.competitionId);
        hash = 29 * hash + Objects.hashCode(this.code);
        return hash;
    }
    
}
